#include <windows.h>
#include <stdio.h>
#include <iostream>

int main()
{
	HANDLE hFile;
    DWORD dwReturn;
	char szTemp[256] = {0};


    hFile = CreateFile(TEXT("\\\\.\\TestDriver"), GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_ALWAYS, 0, NULL);


    if (hFile)
    {
        std::cout << "file created" << std::endl;
		WriteFile(hFile, "Hello from user mode!", sizeof("Hello from user mode!"), &dwReturn, NULL); 
        
		ReadFile(hFile, &szTemp, 256, &dwReturn, NULL);
        printf(szTemp);
        printf("\n");
		
		CloseHandle(hFile);
    }
 
    



	return 0;
}